package cgl.narada.event;

/** This exception is thrown when any of the operations related to the 
    processing of events encounters problems. For example this exception
    can be thrown when there are problems associated with the processing 
    of properties, headers, or distribution-traces within the events.

    @author Shrideep Pallickara
    $Date$
    $Revision$
*/

public class NBEventException extends Exception {

  private String reason;

  private String errorCode;

  private String moduleName = "NBEventException";

  public NBEventException(String reason) {
    this.reason = reason;
  }
  
  public NBEventException(String reason, String errorCode) {
    this.reason = reason;
    this.errorCode = errorCode;
  }
  
  public String toString() {
    String stringRepresentation = moduleName + "->" + reason;
    if (errorCode != null)
      stringRepresentation += (" ErrorCode => " + errorCode);
    return stringRepresentation;
  }


}
